﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>

<script type="text/javascript">
    function SimpleInNewWin() {
        window.open("../AspNetForms/aspnetsimple.aspx");
    }
    $(document).ready(function () {
        $(".dtp").datepicker();
    });

    function GenericInNewWin() {
        var oParam = { "FromDate": "", "ToDate": "" };
        oParam.FromDate = $("#txtFromDate").val();
        oParam.ToDate = $("#txtToDate").val();

        $.ajax({
            url: '../../UsingWebForm/ShowGenericReportInNewWin',
            data: JSON.stringify(oParam),
            type: 'POST',
            contentType: 'application/json;',
            dataType: 'json',
            success: function () {
                window.open("../AspNetForms/aspnetgeneric.aspx", 'mywindow', 'fullscreen=yes, scrollbars=auto');
            }
        });

    }

</script>

    <h2>Index</h2>
    <%=Html.BeginForm("ShowSimple", "UsingWebForm")%>
<%{%>
    <p><strong> Simple Report</strong></p>
    <input type="submit" value="Show simple" />
    <input type="button" value="Show simple in New Window" onclick="SimpleInNewWin()"/>
    <br />
<%}%>

<%=Html.BeginForm("ShowGenericReport", "UsingWebForm")%>
<%{%>
    <p><strong> Generic Report</strong>(With Data and Report Parameter)</p>
    <label>From</label>
    <input type="text" id="txtFromDate" name="txtFromDate" class="dtp" /> <label>To</label>
    <input type="text" id="txtToDate" name="txtToDate"  class="dtp"/> 
    <br />
    <input type="submit" value="Show Generic(Rpt with Data)" />
    <input type="button" value="Show Generic in New Window" onclick="GenericInNewWin()"/>
    <br />
<%}%>

</asp:Content>
